propforth 4.0a 20101212 
30-README-noFS.txt 

Version 4.0a is the same code as version 4.0, with corrections.

Also, this subdirectory to clarify that all functions operate without the mini file system

This example demostrates use on the demo board and/or any setup with 32k EEPROM
NOTE Sal always uses 64k EEPROM on a protoboard.  Braino tests on several platforms as avaiable  

VERSION 4.0a - RELEASE
QA 2010 DEC 11 - Changes to NOV 29
QA 2010 NOV 29

- The core is now a minimum, almost. PropForthPart1.f and PropForthPart2.f have been replaced with PropForthCore.f.
The forth is a subset. Load in the file PropForth.f and do a saveforth to get a fuller forth.
- An optional load structure [if   ] has been added for configuration management reasons.
- A very simple file system for the 64Kx8 eeproms has been added. Thisa allows saving files to the upper part of
eeprom not used by the propeller. Can extend to use mulitiple 64kx8 eeproms, tested up to 3 64kx8 eeproms. fs.f
- The data area size for each cog has bee shrunk to 224 bytes.
- Only one forth cog now starts up, COG 6, it then starts everything else. This make initialization much simpler. 
COG 6 now starts up the default serial cog. As a resultit is very easy to add additional serial cogs.
All cogs are started now by the default routine.
- fl was changed to load the file as it comes in. This takes advantage of the regular IO structure, where a COG
reads the input, and routes it to another cog. A change in behaviour, the cog which compiles the code is not the 
cog the fl command was executed on. Only important when modifying cog specific variables.
- Free cogs are now deemed to be any with no IO connected.
- Regular structure established for cog status, any non forth cogs must adhere to this.

PropForth should run on just about any configuration. 
Try these instruction on the demo board

Built a reference 3 prop system for testing:

Propeller Prototype Board, 5 MHz 64kx8 eeprom.
40 Pin Dip prop chip  added to this board.
spinneret board connected to the Prototype board.

NOTE: the 220 ohm resistors are to limit current in the case of SW misgonfiguration, anything from about 100 - 400 ohms
is suitable. Any larger values will slow down the edges, and can cause problems with the serial and com drivers.

This part of the configuration allows for testing of the norom boot, the serial driver, and the com synchronous
communication driver.

Prototype - the master is a propeller protoboard @ 5 MHZ with a 64kx8 rom,
with a FTDI USB->rs232 attached to the header

Add a prop chip, used a 40 pin dip
Run power and ground 2 0.1 uF caps between the power and ground pins, close to the chip
10k pullup resistor on  IO 29 - the pin normally hookup up to sda on the eeprom


DEMOboard			Prop Chip	
IO 7 	-> 220 ohm resistor 	-> IO 28 (this pin normally hooks up to scl on the eeprom)
IO 6 	-> 220 ohm resistor 	-> IO 29 (this pin normally hooks up to sda on the eeprom, 10k pullup resistor as well)
IO 5	->			-> RESET
IO 4 ->			-> XI

These connections are made to the header on the Spinneret board.
				Spinneret

IO 3	-> 220 ohm resistor	-> IO 30
IO 2	-> 220 ohm resistor 	-> IO 31
IO 1	->			-> RESET
GND	->			-> GND

CHANGE SOURCE CODE ACCORDINGLY
PROTOBoard DemoBoard
8    8         7
9    9         6
10   A         5
11   B         4
Spineret
12   C         3
13   D         2
14   E         1

*******not used on demo+spineret********
CHANGE SOURCE CODE ACCORDINGLY

Protoboard			Prop Chip	
IO 8 	-> 220 ohm resistor 	-> IO 28 (this pin normally hooks up to scl on the eeprom)
IO 9 	-> 220 ohm resistor 	-> IO 29 (this pin normally hooks up to sda on the eeprom, 10k pullup resistor as well)
IO 10	->			-> RESET
IO 11 ->			-> XI

Spinneret
IO 12	-> 220 ohm resistor	-> IO 30
IO 13	-> 220 ohm resistor 	-> IO 31
IO 14	->			-> RESET
GND	->			-> GND

*******not used on demo+spineret: not enough pins********
This is a serial port connection so we can talk to PropForth on the Prop Chip serially if we so choose
*******not used on demo+spineret: these are for Proto Board ********
IO 0	-> 220 ohm resistor 	-> IO 30
IO 1	-> 220 ohm resistor 	-> IO 31
*******not used on demo+spineret: those were for Protoboard********

NOTICE: took out fs.f - demo board does not have the needed 64k EEPROM required to use mini file system 
PropForth.spin  - spin file, load this into eeprom 
PropForth.f     - the additional forth words
LogicAnalyzer.f - a very simple and effective Logic Analyzer, used to look as signals
norom.f         - a set of routines which emulate an eeprom, and allow the booting of a slave chip
com.f           - a high speed synchrounous set of IO channels between 2 props, uses only 2 pins
comnorom.f      - combines norom & com, to boot a chip with no eeprom or XTAL, and then uses the pins
                  normally used for the eeprom to provide 8 synchronous channels
asm.f	- an assembler - NOTE this is loaded into the fs.f example but is not used for time being
snet.f          - configuration to drive the Spinneret board
README.txt      - thE ORIGINAL INSTRUCTIONS FROM prOPfORTH VERSION 4.0
spinneret_eth.f	- beginnings of a new ethernet driver for PropForth, 
                  will use this as a development example, function first,
                  then verification, followed by optimization

Standard regression test process:

1. Connect Propclip to the Spinneret Board and load Propforth.spin into eeprom.
2. Connect PropClip to the DEMO Board and laod Propforth.spin into eeprom.

THIS SET OF TESTS ALL RUN ON THE Demo Board

3. start teraterm, 57kB not other setting change necessary
4. hit enter, words <enter> make sure forth is alive
5. paste contents of PropForthCore.f into teraterm
11. copy the contents of the following files into teraterm
     and do saveforth after each:

propforth.f
LogicAnalyzer.f
norom.f

com.f
comnorom.f
snet.f

20101214 this is as far as I got - DAW

13. reboot, fsload LogicAnaLyzer.f

14. c" hex a aae60 setHza b 6ACFC0 setHzb" 5 cogx, starts up 2 clocks on IO pins A & B, then run
sampleNoTrigger
sampleTrigger
sampleFourTrigger
sampleOneNoTrigger

decimal displayTriggerFrequency hex




Prop0 Cog6 ok
c" hex a aae60 setHza b 6ACFC0 setHzb" 5 cogx
Prop0 Cog6 ok

Prop0 Cog6 ok
sampleNoTrigger

0A-_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_-

0B__-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_-

0C----------------------------------------------------------------------------------------------------------------------------------------------------------------

0D----------------------------------------------------------------------------------------------------------------------------------------------------------------

0E----------------------------------------------------------------------------------------------------------------------------------------------------------------

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
sampleTrigger

0A-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_

0B_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-

0C----------------------------------------------------------------------------------------------------------------------------------------------------------------

0D----------------------------------------------------------------------------------------------------------------------------------------------------------------

0E----------------------------------------------------------------------------------------------------------------------------------------------------------------

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
sampleFourTrigger

0A_____________--------------_______________--------------______________---------------______________--------------______________---------------__________________

0B__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_-______

0C----------------------------------------------------------------------------------------------------------------------------------------------------------______

0D----------------------------------------------------------------------------------------------------------------------------------------------------------______

0E----------------------------------------------------------------------------------------------------------------------------------------------------------______

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
sampleOneNoTrigger

0A----------------------------------_________________________________________________________---------------------------------------------------------____________

0B----______------_____------______-----______------______-----______------_____------______------_____------______-----______------______-----______------_____--

0C----------------------------------------------------------------------------------------------------------------------------------------------------------------

0D----------------------------------------------------------------------------------------------------------------------------------------------------------------

0E----------------------------------------------------------------------------------------------------------------------------------------------------------------

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
decimal displayTriggerFrequency hex
701754.385
Prop0 Cog6 ok


15. reboot, fsload com.f, Define the 2 following routines


fl
: cominit
	c" 14 15 FF 3 commaster" 4 cogx
	c" 14 15 FF 3 comslave" 5 cogx
	100 delms
	0 0 5 0 (ioconn)
	1 0 5 1 (ioconn)
	2 0 5 2 (ioconn) ;

: comstat 4 cogio dup comcnt L@ . comerr L@ . 5 cogio dup comcnt L@ . comerr L@ . cr ;



16. type: ( this starts a terminal, and connect to cog0  via the com interfaces, CTL-F exits
cominit comstat
4 0 term 



Prop0 Cog6 ok
fl
: cominit
 c" 14 15 FF 3 commaster" 4 cogx
 c" 14 15 FF 3 comslave" 5 cogx
 100 delms
 0 0 5 0 (ioconn)
 1 0 5 1 (ioconn)
 2 0 5 2 (ioconn) ;
Prop0 Cog0 ok

Prop0 Cog0 ok
: comstat 4 cogio dup comcnt L@ . comerr L@ . 5 cogio dup comcnt L@ . comerr L@ . cr ;
Prop0 Cog0 ok

Prop0 Cog0 ok

Prop0 Cog6 ok
cominit comstat
CE 0 EC 0
Prop0 Cog6 ok
4 0 term
Hit CTL-F to exit term

Prop0 Cog0 ok

Prop0 Cog0 ok

Prop0 Cog0 ok
1 2 3 . . .
3 2 1 Prop0 Cog0 ok
Prop0 Cog6 ok



THIS SET OF TESTS ALL RUN ON THE Proto Board + the 40 pin Propeller Chip

17. reboot, 

17a. copy and paste norom.f into teraterm window
                                               
18. Define to following words, run demo, CTL-F to exit

fl
: bootslave 8 9 A B rambootnx ;
: demo bootslave 1 0 e100 4 startserialcog 10 delms 4 0 term ;

\ 4 0 term - will connect again after demo is run


Prop0 Cog6 ok
fl
: bootslave 8 9 A B rambootnx ;
Prop0 Cog0 ok
: demo bootslave 1 0 e100 4 startserialcog 10 delms 4 0 term ;
Prop0 Cog0 ok

Prop0 Cog6 ok
demo
Hit CTL-F to exit term

 SLAVEProp8 Cog6 ok

 SLAVEProp8 Cog6 ok
1 2 3 . . .
3 2 1  SLAVEProp8 Cog6 ok
Prop0 Cog6 ok

19. reboot, 

19a. copy and paste comnorom.f into the teraterm window

20. run the following and use CTL-F to exit:
0 onboot
5 0 term

NOTE: 5 0 term connect MASTER cog 5 high dspeed synchronous serial channel on MASTER PINS pins 8&9
to SLAVE high speed serial channel on SLAVE pins 28&29 to slave cog 0.  
SLAVE High speed serial channel and user interface is manged by cog7
The transactions and output should look like this:   

Prop0 Cog6 ok
0 onboot
MASTERProp0 Cog6 ok
5 0 term
Hit CTL-F to exit term

 SLAVEProp8 Cog0 ok
1 2 3 . . .
3 2 1  SLAVEProp8 Cog0 ok
MASTERProp0 Cog6 ok


THIS SET OF TESTS ALL RUN ON THE Proto Board + Spinneret Board

21. reboot, load snet.f, run snet, CTL-F to exit

22. define the following words, do a saveforth, reboot
: _ob onboot ;
: onboot _ob c" SNETProp" prop W! ;


Prop0 Cog6 ok
: _ob onboot ;
Prop0 Cog6 ok
: onboot _ob c" SNETProp" prop W! ;
Prop0 Cog6 ok
saveforth
..........................................................................................................................................................
Prop0 Cog6 ok
reboot
RESET SNETProp0 Cog6 ok

SNETProp0 Cog6 ok
1 2 3 . . .
3 2 1 SNETProp0 Cog6 ok

SNETProp0 Cog6 ok
Prop0 Cog6 ok






